/*********************************************************************************
 * File Name: CallUtil.java
 * Package Name: com.sensorfriendly.util
 * 
 * Purpose:
 * Start an activity to make a call to the Emergency call number
 *  
 *********************************************************************************/
package com.sensorfriendly.util;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;

public class CallUtil {
	
	public static void call(Activity activity, String phoneNum) {
	    try {
	        Intent callIntent = new Intent(Intent.ACTION_CALL);
	        
	        // Set the phone number from the Intent
	        callIntent.setData(Uri.parse("tel:"+phoneNum));
	        
	        // Call the activity to make the call with
	        activity.startActivity(callIntent);
	    } catch (ActivityNotFoundException activityException) {
	         Log.e("", "Call failed", activityException);
	    }
	}
	
}
